/* eslint-disable @typescript-eslint/no-unused-expressions */
// 存入本地
export function setLocalStorage(name: any, param: any) {
  localStorage.setItem(name, JSON.stringify(param));
}
// 从本地取出
export function getLocalStorage(name: string) {
  const res = localStorage.getItem(name);
  return res ? JSON.parse(res) : undefined;
}
// 删除本地存储
export function clearLocalStorage(name: string = '') {
  if (name) {
    localStorage.removeItem(name);
  } else {
    localStorage.clear();
  }
  // !!name ? localStorage.removeItem(name) : localStorage.clear()
}
